﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace Light.Aop
{
    /// <summary>
    /// 缓存支持类特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class CacheClassAttribute : ContextAttribute, IContributeObjectSink
    {
        public CacheClassAttribute()
            : base("CacheClass")
        {
        }

        public IMessageSink GetObjectSink(MarshalByRefObject obj, IMessageSink nextSink)
        {
            return new Light.Aop.Interceptor.CacheInterceptor(nextSink);
        }
    }
}
